package com.parkreport.admin.areacity.action;

import java.util.ArrayList;
import java.util.List;

import com.common.pager.PageHelper;
import com.common.pager.PagerVO;
import com.common.util.StringUtil;
import com.parkreport.admin.areacity.service.AreaCityService;
import com.parkreport.base.BaseAction;
import com.parkreport.vo.CarAreaVO;
import com.parkreport.vo.LareaVO;

public class AreaCityAction extends BaseAction {
	private PagerVO pagerVO = null;
	private String ids = null;
	private String id="";
	
	private AreaCityService service = new AreaCityService();
	private List<LareaVO> list = new ArrayList<LareaVO>();
	private LareaVO vo = new LareaVO();


	public String find(){
		log.info("==========find============");
		PageHelper pager = new PageHelper(this.getRequest());
		
		list = service.find(vo,pager);
		pagerVO = pager.paginate();
		
		return topager("/pages/admin/areacity/list.jsp");
		
	}
	
	public String edit(){
		log.info("==========edit============");
		if(!StringUtil.isBlank(id)){
			vo = service.get(id);
		}

		return topager("/pages/admin/areacity/edit.jsp");
		
	}
	
	public String save(){
		log.info("==========save============");
		String isSave = service.save(vo);
		
		this.getRequest().setAttribute("saveFlag", isSave);
		return topager("/pages/admin/areacity/edit.jsp");
	}
	public void delete(){
		log.info("==========delete============"+ids);
		service.delete(ids);
		
	}

	
	
	//=========setter getter ===================
	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public List<LareaVO> getList() {
		return list;
	}

	public void setList(List<LareaVO> list) {
		this.list = list;
	}

	public LareaVO getVo() {
		return vo;
	}

	public void setVo(LareaVO vo) {
		this.vo = vo;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public PagerVO getPagerVO() {
		return pagerVO;
	}

	public void setPagerVO(PagerVO pagerVO) {
		this.pagerVO = pagerVO;
	}

	
	
}
